package com.gillion.grule.client.utils;



public class FormattingTuple {
    public static FormattingTuple NULL = new FormattingTuple(null);

    private String message;

    private Object[] argArray;

    public FormattingTuple(String message) {
        this(message, null);
    }

    public FormattingTuple(String message, Object[] argArray) {
        this.message = message;
        this.argArray = argArray;
    }

    static Object[] trimmedCopy(Object[] argArray) {
        if (argArray == null || argArray.length == 0)
            throw new IllegalStateException("non-sensical empty or null argument array");
        int trimemdLen = argArray.length - 1;
        Object[] trimmed = new Object[trimemdLen];
        System.arraycopy(argArray, 0, trimmed, 0, trimemdLen);
        return trimmed;
    }

    public String getMessage() {
        return this.message;
    }

    public Object[] getArgArray() {
        return this.argArray;
    }
}

